package com.code.zjm.entity;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by ZJM on 2017/4/27.
 * 用户实体类
 */

public class User implements Parcelable {
    private int _id;//用户id
    private String username;//用户名
    private String mobilePhone;//移动电话
    private String officePhone;//办公电话
    private String familyPhone;//家庭电话
    private String position;//职位
    private String company;//公司名称
    private String address;//地址
    private String zipCode;//邮政编码
    private String email;//email
    private String otherContact;//其他联系方式
    private String remark;//备注
    private int imageId;//图片
    private int privacy;//1代表隐私用户  0代表普通用户

    public User() {
    }

    /**
     * 初始化数据构造器
     * @param id   id
     * @param username  username
     * @param mobilePhone  mobilePhone
     * @param officePhone  officePhone
     * @param familyPhone  familyPhone
     * @param position  position
     * @param company  company
     * @param address  address
     * @param zipCode  zipCode
     * @param email  email
     * @param otherContact  otherContact
     * @param remark  remark
     * @param imageId  imageId
     * @param privacy  privacy
     */
    public User(int id, String username, String mobilePhone, String officePhone, String familyPhone, String position, String company, String address, String zipCode, String email, String otherContact, String remark, int imageId, int privacy) {
        this._id = id;
        this.username = username;
        this.mobilePhone = mobilePhone;
        this.officePhone = officePhone;
        this.familyPhone = familyPhone;
        this.position = position;
        this.company = company;
        this.address = address;
        this.zipCode = zipCode;
        this.email = email;
        this.otherContact = otherContact;
        this.remark = remark;
        this.imageId = imageId;
        this.privacy = privacy;
    }

    protected User(Parcel in) {
        _id= in.readInt();
        username = in.readString();
        mobilePhone = in.readString();
        officePhone = in.readString();
        familyPhone = in.readString();
        position = in.readString();
        company = in.readString();
        address = in.readString();
        zipCode = in.readString();
        email = in.readString();
        otherContact = in.readString();
        remark = in.readString();
        imageId = in.readInt();
        privacy = in.readInt();
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(_id);
        dest.writeString(username);
        dest.writeString(mobilePhone);
        dest.writeString(officePhone);
        dest.writeString(familyPhone);
        dest.writeString(position);
        dest.writeString(company);
        dest.writeString(address);
        dest.writeString(zipCode);
        dest.writeString(email);
        dest.writeString(otherContact);
        dest.writeString(remark);
        dest.writeInt(imageId);
        dest.writeInt(privacy);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<User> CREATOR = new Creator<User>() {
        @Override
        public User createFromParcel(Parcel in) {
            return new User(in);
        }

        @Override
        public User[] newArray(int size) {
            return new User[size];
        }
    };


    //get 与 set 方法
    public int get_id() {
        return _id;
    }

    public void set_id(int _id) {
        this._id = _id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getMobilePhone() {
        return mobilePhone;
    }

    public void setMobilePhone(String mobilePhone) {
        this.mobilePhone = mobilePhone;
    }

    public String getOfficePhone() {
        return officePhone;
    }

    public void setOfficePhone(String officePhone) {
        this.officePhone = officePhone;
    }

    public String getFamilyPhone() {
        return familyPhone;
    }

    public void setFamilyPhone(String familyPhone) {
        this.familyPhone = familyPhone;
    }

    public String getPosition() {
        return position;
    }

    public void setPosition(String position) {
        this.position = position;
    }

    public String getCompany() {
        return company;
    }

    public void setCompany(String company) {
        this.company = company;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getZipCode() {
        return zipCode;
    }

    public void setZipCode(String zipCode) {
        this.zipCode = zipCode;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getOtherContact() {
        return otherContact;
    }

    public void setOtherContact(String otherContact) {
        this.otherContact = otherContact;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public int getImageId() {
        return imageId;
    }

    public void setImageId(int imageId) {
        this.imageId = imageId;
    }

    public int getPrivacy() {
        return privacy;
    }

    public void setPrivacy(int privacy) {
        this.privacy = privacy;
    }


    //重写toString
    @Override
    public String toString() {
        return super.toString();
    }
}
